<!DOCTYPE html>
<html>
	<head>
		<include file="Public/head" />
		<link rel="stylesheet" href="__PUBLIC__/Manage/css/table.css">
		<title>管理员列表</title>
	</head>
	<body>
		<div class="nestable">
			<div class="console-title console-title-border drds-detail-title clearfix">
				<h5>管理员列表</h5>
			</div>
			<div class="public-btnArea">
	        	<a href="{:U('Admin/add')}" class="btn btn-grayBg">
	            	<i class="glyphicon glyphicon-plus public-ico"></i>
	                <span class="public-label">添加管理员</span>
	            </a>
        	</div>
			<div class="scroll-bar-table">
				<table class="table table-hover">
					<thead>
						<tr>
							<th>序号</th>
							<th>用户名</th>
							<th>最后登录时间</th>
							<th>最后登录IP</th>
							<th>状态</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
<php>$status = array('禁用','启用');</php>
<volist name="list" id="vo">
						<tr id="list-{$vo.id}">
							<td>{$vo.id}</td>
							<td>{$vo.username}</td>
							<td>{$vo.last_time|date="Y-m-d H:i:s",###}</td>
							<td>{$vo.last_ip}</td>
							<td>{$status[$vo['status']]}</td>
							<td class="text-left">
								<a href="{:U('Admin/edit',array('id'=>$vo['id']))}">编辑</a>
								<a href="javascript:delAdmin('{$vo.id}','{$vo.username}');">删除</a>
								<a href="{:U('Admin/view',array('id'=>$vo['id']))}">查看</a>
							</td>
						</tr>
</volist>
					</tbody>
				</table>
			</div>
			<div class="table-pagin-container">
				<div class="pull-right page-box">
					{$page}
				</div>
			</div>
		</div>
	</body>
	<script>
		function delAdmin(id,name){
			layer.confirm(
				'确定要删除管理员:'+name+'吗？',
				{
					btn: ['确认删除','取消']
				},function(){
					cvphp.post(
						"{:U('Admin/del')}",
						{
							id:id
						},
						function(data){
							if(data.status!=1){
								layer.msg(data.info);
							}else{
								$("#list-"+id).remove();
								layer.msg("操作成功");
							}
						}
					);
				}
			);
		}
	</script>
</html>